export default class InvocationHandler {
  
    constructor(){
     
    }

   async invoke(master,slave,  method,  args) {
       let l,r;
      
       if(method.startsWith('left')|| method.startsWith('_')){
         l =  await  master.__proto__[method].apply(master,args);
       }else if(method.startsWith('right') ){
         r = await slave.__proto__[method].apply(slave,args);
       }else{
         l =  await  master.__proto__[method].apply(master,args);
         r = await slave.__proto__[method].apply(slave,args);
       }
      
        //console.log("-----执行了 " + method + " 方法-----")
    
        return Promise.resolve([l,r]);
     }

}